package com.yunji.base.service;

import com.yunji.base.convert.FeedbackConvert;
import com.yunji.base.dao.IFeedbackDao;
import com.yunji.base.domain.FeedbackDO;
import com.yunji.common.model.dto.FeedbackDTO;
import com.yunji.common.model.params.FeedbackParam;
import com.yunji.common.model.vo.FeedbackExportVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.message.service
 * @Title: IFeedbackService
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-10-30 09:30:16      V1.0        HuaAo       新建类
 */
@Slf4j
@Service
public class FeedbackService {

    @Resource
    IFeedbackDao feedbackDao;

    public boolean create(FeedbackDO create) {
        return feedbackDao.save(create);
    }

    public List<FeedbackDO> searchList(FeedbackParam param) {
        return feedbackDao.searchList(param);
    }

    public List<FeedbackExportVO> search(FeedbackParam param) {
        return feedbackDao.search(param);
    }

    public boolean update(FeedbackDTO dto) {
        FeedbackDO feedback = FeedbackConvert.convertDTO(dto);
        return feedbackDao.updateById(feedback);
    }

    public FeedbackDO select(Long feedbackId) {
        return feedbackDao.getById(feedbackId);
    }

    public boolean deleteByIds(List<Long> ids) {
        return feedbackDao.removeBatchByIds(ids);
    }

    public List<String> searchTableField(FeedbackParam param) {
        return feedbackDao.searchTableField(param);
    }
}